/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cxhd.lis.model.newmodel;

import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;

/**
 *
 * @author cxhd
 */
@SuppressWarnings("serial")
public class ZkControlmaterials  extends Model<ZkControlmaterials> {
     public static final ZkControlmaterials zkControlmaterialsdao=new ZkControlmaterials();
     public void deleteZkControl(String PK){
        Db.use("mysql").update("delete from zk_controlmaterials where PK="+Integer.valueOf(PK));
    }
     public void saveZkControl(Controller con){
         set("MAJORPK",Integer.valueOf(con.getPara("MAJORPK")))
                 .set("PRODUCTIONTIME",con.getPara("PRODUCTIONTIME"))
                 .set("BATCHNUMBER",con.getPara("BATCHNUMBER"))
                  .set("EXFACTORY",con.getPara("EXFACTORY"))
                 .set("EFFECTIVETIME",con.getPara("EFFECTIVETIME"))
                 
                 .save();
     }
     //select PK,MAJORPK,PRODUCTIONTIME, BATCHNUMBER,EXFACTORY,EFFECTIVETIME from zk_controlmaterials
     public void updateZkControl(Controller con){
         findById(Integer.valueOf(con.getPara("PK")))
                  .set("MAJORPK",Integer.valueOf(con.getPara("MAJORPK")))
                 .set("PRODUCTIONTIME",con.getPara("PRODUCTIONTIME"))
                 .set("BATCHNUMBER",con.getPara("BATCHNUMBER"))
                  .set("EXFACTORY",con.getPara("EXFACTORY"))
                 .set("EFFECTIVETIME",con.getPara("EFFECTIVETIME"))
                 .update();
     }
}
